package com.hnhegui.backend.order.controller;

import com.hnhegui.backend.entity.Result;
import com.hnhegui.backend.order.api.FulfillmentRestApi;
import com.hnhegui.backend.order.dto.request.FulfillmentRequestDTO;
import com.hnhegui.backend.order.dto.response.FulfillmentResponseDTO;
import com.hnhegui.backend.order.service.FulfillmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 刘大海
 * @since 2025/10/27 10:49
 */
@RestController
@RequestMapping("/api/fulfillments")
public class FulfillmentController implements FulfillmentRestApi {

    @Autowired
    private FulfillmentService fulfillmentService;

    @Override
    public Result<FulfillmentResponseDTO> processFulfillment(FulfillmentRequestDTO request) {
        FulfillmentResponseDTO response = fulfillmentService.processFulfillment(request);
        return Result.success(response);
    }
}
